package com.mdd.admin.validate.banner;

import com.mdd.common.validator.annotation.IntegerContains;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel("广告创建参数")
public class BannerUpdateValidate implements Serializable {

    private static final long serialVersionUID = 1L;


    @NotNull(message = "id参数必传且需大于0")
    @ApiModelProperty(value = "id", required = true)
    private Long id;

    @NotEmpty(message = "广告标题不能为空")
    @Length(min = 1, max = 50, message = "广告标题不能大于50个字符")
    @ApiModelProperty(value = "广告标题", required = true)
    private String title;

    @Length(max = 250, message = "内容不能超出250个字符")
    @ApiModelProperty(value = "内容")
    private String content = "";

    @Length(max = 250, message = "图片链接过长不能超200个字符")
    @ApiModelProperty(value = "图片简介")
    private String imgSrc = "";

    @Length(max = 250, message = "详情链接不能超过250个字符")
    @ApiModelProperty(value = "作者姓名")
    private String link = "";

    @NotNull(message = "广告类型不能为空")
    @IntegerContains(values = {0, 1}, message = "bannerType不是合法值")
    @ApiModelProperty(value = "广告类型", required = true)
    private Integer bannerType;

    @NotNull(message = "缺少isShow参数")
    @IntegerContains(values = {0, 1}, message = "isShow不是合法值")
    @ApiModelProperty(value = "是否显示", required = true)
    private Integer isShow;

}
